﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="../style.css">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body>

<?php	

	include("../inc/joomlaInt_admin.php");
	include("../inc/inc_configuration.php");
	
if ($jUser==0)
{
	echo "Bitte zuerst einloggen!";
}
else
{
	
	$q="SELECT gid FROM $tbl_users WHERE id=$jUser";
					$qe=mysql_query($q);
					$qeo=mysql_fetch_object($qe);
					
					$gid=$qeo->gid;
					
					if ($gid!=$admingroup)
					{
						echo "Du bist kein Admin!";
						break;
					}
					
	$liga=$_GET["liga"];
	
	$q="	SELECT 
				*
			FROM
				$tbl_rankings
			WHERE
				leagueId=$liga
			ORDER BY
				start ASC";
				
	$qe=mysql_query($q);
	
	$count=mysql_num_rows($qe);
	
	if ($count>0)
	{
		echo "<table>
				<tr id='tabelle'>
					<th>Plätze</th>
					<th></th>
					<th>Farbe</th>
					<th></th>
				</tr>";
		
		while ($row=mysql_fetch_object($qe))
		{
			$id=$row->id;
			$s=$row->start;
			$e=$row->end;
			$t=$row->text;
			$c=$row->color;
			
			echo "	<tr>
						<td>$s.- $e.</td>
						<td>$t</td>
						<td bgcolor='",$c,"'></td>
						<td><a href='ranking_entfernen.php?id=",$id,"&liga=",$liga,"' class='minibutton entfernen'></a></td>
					</tr>";
		}
		
		echo "	<tr id='tabelle'>
					<th colspan='4'></th>
				</tr>
			</table>";
	}
	
	echo "<br><br>
			<center><a href='ranking_anlegen.php?liga=",$liga,"' class='button anlegen'>Anlegen</a></center></center>";
	
	echo "<br><br>
			<center><a href='liga.php?liga=",$liga,"' class='button zurueck'>Zurück</a></center></center>";
	
	
}	
	
?>

</body>
</html>